import request from '../utils/request'
// 获取商品列表
export const getGoods = params => {
  return request({
    url: 'goods',
    method: 'GET',
    params
  })
}

// 删除商品
export const removeGoods = id => {
  return request({
    url: 'goods/' + id,
    method: 'delete'
  })
}

// 获取分类列表
export const getCategories = () => {
  return request({
    url: 'categories',
    method: 'GET'
  })
}

// 商品属性分类
export const getParameterList = (id, params) => {
  return request({
    url: `categories/${id}/attributes`,
    method: 'GET',
    params
  })
}

// 添加商品
export const addTheGoods = data => {
  return request({
    url: 'goods',
    method: 'POST',
    data
  })
}
